<%@page import="com.netistate.pojo.UserProject"%>
<%@page import="com.netistate.pojo.User"%>
<%@page import="com.netistate.pojo.Project"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<div class="minWin">
   <form id="myForm" action="#" method="post">
	<table id="" width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="bg_color_common" style="font-size: 12">
		<tr>
			<td title="项 目 名 称" align="right">项目名称:
			</td>
			<td>
			    <input type="hidden" name="user.username" id="username"  value="${session_user.username }"/>
				<input  id="editProjectName" name="project.projectName" value="${sessionScope.projectById.projectName }"/>
			</td>
		</tr>
		<c:forEach var="pl" items="${sessionScope.projectList }">
			<input type="hidden" id="projectNameList" name="projectNameList" value="${pl.projectName }"/>
		</c:forEach>
		<tr>
			<td title="项目负责人" align="right">项目负责人:
			</td>
			<td>
				<select id="editManager" name="manager">
					<%
						List<User> userlist = (List<User>)request.getSession().getAttribute("userList");
						//拿着id去找到的那个项目
						Project p = (Project)request.getSession().getAttribute("projectById");
						for(User u : userlist){
							if(p.getProjectManager().equals(u.getUsername())){
					 %>
				   		<option value="<%=u.getUsername() %>" selected="selected"><%=u.getRealName() %></option>
				   		<% }else {%>
				   		<option value="<%=u.getUsername() %>" ><%=u.getRealName() %></option>
				  		<% }
				   		}%>
				</select>
			</td>
		</tr>
		<input type="hidden" name="pid" id="pid" value="<%=p.getId()%>"/>
		<tr>
			<td title="项目组成员" align="right">项目组成员:
			</td>
			<td>
				<!-- 让是项目组的成员打勾，不是的不打勾  不会做 后台也没传值 -->
				<% for(User u : userlist){%>
			   			<input type="checkbox" <%=p.getProjectMember().indexOf(u.getUsername()+",")>=0?"checked":"" %> name="editMember" value="<%=u.getUsername() %>" /><%=u.getRealName() %>
			   	<%}%>
			
			</td>
		</tr>
		<tr>
			<td title="项目阶段" align="right">项目阶段:
			</td>
			<td>
				<select id="editProcess" name="process">
				<% if("售前".equals(p.getProjectProcess())){ %>
				 	<option selected="selected" value="售前">售前</option>
				 	<option value="已签单">已签单</option>
				    <option value="实施">实施</option>
				    <option value="已验收">已验收</option>
				    <option value="停滞">停滞</option>
				<%} %>
				<% if("已签单".equals(p.getProjectProcess())){ %>
				 	<option selected="selected" value="已签单">已签单</option>
				 	<option value="售前">售前</option>
				    <option value="实施">实施</option>
				    <option value="已验收">已验收</option>
				    <option value="停滞">停滞</option>
				<% } %>
				<% if("实施".equals(p.getProjectProcess())){ %>
				 	<option selected="selected" value="实施">实施</option>
				 	<option value="售前">售前</option>
				    <option value="已签单">已签单</option>
				    <option value="已验收">已验收</option>
				    <option value="停滞">停滞</option>
				<%  } %>
				<% if("已验收".equals(p.getProjectProcess())){ %>
				 	<option selected="selected" value="已验收">已验收</option>
				 	<option value="售前">售前</option>
				    <option value="已签单">已签单</option>
				    <option value="实施">实施</option>
				    <option value="停滞">停滞</option>
				<% } %>
				<% if("停滞".equals(p.getProjectProcess())){ %>
				 	<option selected="selected" value="停滞">停滞</option>
				 	<option value="售前">售前</option>
				    <option value="已签单">已签单</option>
				    <option value="实施">实施</option>
				    <option value="已验收">已验收</option>
				<%  } %>
				</select>
			</td>
		</tr>
		<tr>
			<td title="客户名称" align="right">客户名称:
			</td>
			<td>
				<input  id="editClientName" name="project.clientName" value="${sessionScope.projectById.clientName }"/>
			</td>
		</tr>
		<tr>
			<td title="客户地址" align="right">客户地址:
			</td>
			<td>
				<input  id="editClientAddress" name="project.clientAddress" value="${sessionScope.projectById.clientAddress }"/>
			</td>
		</tr>
		<tr>
			<td title="项 目 描 述" align="right">项目描述:
			</td>
			<td>
				<textarea rows="13" cols="41" name="project.descr" id="editDesc">${sessionScope.projectById.descr }</textarea>
			</td>
		</tr>
	</table>
	</form>
</div>
